//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.jeeplus.common.properties;

import java.io.InputStream;
import java.util.Properties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class QiniuProperties {
    private static final Logger logger = LoggerFactory.getLogger(QiniuProperties.class);
    private static Properties properties;
    private static Properties defaultProperties = new Properties();

    static {
        try {
            properties = new Properties(defaultProperties);
            InputStream stream = QiniuProperties.class.getClassLoader().getResourceAsStream("qiniu.properties");
            if(stream != null) {
                properties.load(stream);
            }
        } catch (Exception var1) {
            logger.warn("Read config.properties error.", var1);
        }

    }

    public QiniuProperties() {
    }

    public static Properties getProperties() {
        return properties;
    }

    public static Properties getDefaultProperties() {
        return defaultProperties;
    }

    public static String getProperty(String key) {
        return properties.getProperty(key);
    }

    public static String getProperty(String key, String defaultValue) {
        return properties.getProperty(key, defaultValue);
    }

    public static void setProperty(String key, String value) {
        properties.setProperty(key, value);
    }

    public static int getPropertyForInteger(String key) {
        String value = getProperty(key);

        try {
            return Integer.parseInt(value);
        } catch (Exception var3) {
            throw new IllegalArgumentException("ת�� \"" + value + "\" Ϊ int ���̷������������� properties ����Ϊ " + key);
        }
    }

    public static int getPropertyForInteger(String key, String defaultValue) {
        String value = getProperty(key, defaultValue);

        try {
            return Integer.parseInt(value);
        } catch (Exception var4) {
            throw new IllegalArgumentException("ת�� \"" + value + "\" Ϊ int ���̷������������� properties ����Ϊ " + key);
        }
    }

    public static boolean getPropertyForBoolean(String key, String defaultValue) {
        String value = getProperty(key, defaultValue);

        try {
            return Boolean.parseBoolean(value);
        } catch (Exception var4) {
            throw new IllegalArgumentException("ת�� \"" + value + "\" Ϊ boolean ���̷������������� properties ����Ϊ " + key);
        }
    }
}
